package com.project.util;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class PressException {

    //当服务器抛出指定异常，或该异常的子类对象时，执行该方法
    @ExceptionHandler(Exception.class)
    public String press(){
//        return "redirect:/error.html";
        return "出错了";
    }
}
